//
//  CustomBillView.swift
//  KaMengApplication
//
//  Created by DUONIU_MAC on 2018/11/6.
//  Copyright © 2018年 DUONIU_MAC. All rights reserved.
//

import UIKit

class CustomBillView: UIView {
    
    let customBtn = UIButton()

    init() {
        super.init(frame: .zero)
        
        self.backgroundColor = UIColor.white
        
        self.addSubview(customBtn)
        
        let titleLabel = UILabel()
        titleLabel.text = customBilling
        titleLabel.font = UIFont.systemFont(ofSize: RATIO(maxNum: 20))
        customBtn.addSubview(titleLabel)
        
        let imageView = UIImageView()
        imageView.image = UIImage.init(named: "custom")
        customBtn.addSubview(imageView)
        
        customBtn.snp.makeConstraints { (make) in
            make.left.right.equalToSuperview()
            make.top.equalToSuperview().offset(RATIO_H(maxNum: 10))
            make.bottom.equalToSuperview().offset(RATIO_H(maxNum: -10))
        }
        
        titleLabel.snp.makeConstraints { (make) in
            make.centerX.equalToSuperview().offset(RATIO(maxNum: -20))
            make.centerY.equalToSuperview()
            make.width.greaterThanOrEqualTo(10)
            make.height.greaterThanOrEqualTo(10)
        }
        
        imageView.snp.makeConstraints { (make) in
            make.centerY.equalToSuperview()
            make.left.equalTo(titleLabel.snp.right).offset(RATIO(maxNum: 5))
            make.width.height.equalTo(RATIO_H(maxNum: 15))
        }
        
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    

}
